import apis from "../../http/apis/apis.js"
export default {
    namespaced: true,
    state: {
        tenants: [],
        dataPage: {
            pageSize: 5,
            currentPage: 1,
            total: 10,
            _id: '',
            agreenState: 1,
        }
    },
    gatters: {

    },
    mutations: {
        getTenants(state, data) {
            state.tenants = data.data;
            state.dataPage.total = data.total;
        },
        getLessors(state, data) {
            state.lessors = data.data;
            state.dataPage.total = data.total;
        },
        setPageData(state, newPageData) {
            state.dataPage = newPageData;
        },
        setCurrentPage(state, newCurrentPage) {
            state.dataPage.currentPage = newCurrentPage;
        },
        setPageSize(state, newPageSize) {
            state.dataPage.pageSize = newPageSize
        }

    },
    actions: {
        // 获取出租方的信息
        async getTenants(context, param) {
            const { data } = await apis.adminTenants.getTenants(param);
            context.commit('getTenants', data);

        },
    }

}